<!DOCTYPE html>
<html lang="zh-cmn-Hans">

	<head>
		<meta charset="UTF-8">
		<link rel="shortcut icon" href="favicon.ico">
		<link rel="stylesheet" href="css/iconfont.css">
		<link rel="stylesheet" href="css/global.css">
		<link rel="stylesheet" href="css/bootstrap.min.css">
		<link rel="stylesheet" href="css/bootstrap-theme.min.css">
		<link rel="stylesheet" href="css/swiper.min.css">
		<link rel="stylesheet" href="css/styles.css">
		<link rel="stylesheet" href="css/yangshi.css" />
		<link rel="stylesheet" href="css/logo.css" />
		<script src="js/jquery.1.12.4.min.js" charset="UTF-8"></script>
		<script src="js/bootstrap.min.js" charset="UTF-8"></script>
		<script src="js/swiper.min.js" charset="UTF-8"></script>
		<script src="js/global.js" charset="UTF-8"></script>
		<script type="text/javascript" src="layui/layui.js" charset="utf-8"></script>
		<script src="js/jquery.DJMask.2.1.1.js" charset="UTF-8"></script>
		<!-- 红包雨css -->
		<link rel="stylesheet" href="css/huodong/hongbaoyu.css">
		<!-- 秒杀css -->
		<link rel="stylesheet" href="css/huodong/miaosha.css">
		<!-- 领劵中心css-->
		<link rel="stylesheet" href="css/huodong/lingjuanzhongxing.css">
		
	 <script src="js/hby.js"></script>
		 <link rel="stylesheet" href="./css/cdn.css">
		<title>赛杰百货</title>
	</head>
	<style type="text/css">
		#body {
			width: 1200px;
			margin: auto;
		}
		
		body {
			background: #e0e7ea;
		}

		#coverimg{
			position: relative;			
			width: 800px;
		}
		.swiper-slide{
			text-align: center;
			width: 800px;
		}
				.aaa:ul,
		li {
			list-style: none;
			width: 60%;
		}
		
		.aaa:ul {
			border: 1px solid #ddd;
			border-top: none;
			display: none;
		}
		
		.aaa:li {
			padding: 0 10px;
			height: 30px;
			line-height: 30px;
			cursor: pointer;
		}
		
		.lis {
			cursor: pointer;
			padding: 5px;
		}
		
		.lis:hover {
			background: #8C8C8C;
		}
		
		.aaa {
			background-color: white;
			font-size: 12px;
		}
		
		.test {
			background: white;
			width: 100%;
			height: 20px;
			float: left;
		}
		
		.delsss {
			float: right;
			border: none;
			width: 30px;
			height: 17px;
			color: white;
			background: none;
			font-size: 12px;
		}
		
		.delsss:hover {
			cursor: pointer;
			color: red;
}
	
		.sansan:hover{
			color: red;
			cursor: pointer;
		}
		.hby1{
			position: fixed;
			top: 500px;
			z-index: 99;
		}
		#ms {
			height: 350px;
			width: 1000px;
			position: relative;
			left: 190px;
		}
		#xp{
			position: relative;
			left: -50px;
		}
	</style>

	<body>
	<div class="hby1 hd" onclick="sss()">
			<div class="hob-inlet" id="hob-inlet">
				<div class="hob-inlet-03"></div>
				<div class="hob-inlet-02"></div>
				<div class="hob-inlet-01"></div>
			</div>
			<div class="hongbao-wrapper">
				<div class="hob-cd">

				</div>
				<div class="hob-close"></div>
				<div class="btn-l btn-red for-get-now">
					快抢红包！
				</div>
			</div>

				<script>
				
				cz = 10000
				setInterval(function(){

					
					if(1<document.getElementById("shi").innerText&& document.getElementById("fen").innerText==0&& document.getElementById("miao").innerText==0){
						jjst()
					}
					
				},1000)
			
				function  jjst () {
				
				$(function() {
					//hobYU()
					function hobYU() {
						//  setCookie('hob','hob',1);//存储标记
						$('.hongbao-wrapper').fadeIn();
						var h_con = 0,
							isPc;
						var HONGBAO = setInterval(function() {
								var _r = ['50%', '70%', '90%', '100%']
								$(window).width() > 800 ? isPc = 0 : isPc = 1;
								var HTML_i = $('<i style="background-size:' + _r[parseInt(Math.random() * 4)] + ';left:' + (parseInt(Math.random() * 6) - isPc) * 18 + '%"></i>');
								$('.hongbao-wrapper').append(HTML_i);
								var _left = HTML_i.offset().left + 300
								HTML_i.animate({
									'top': '120%',
									'left': _left
								}, 1200, 'linear')
								$('.hob-cd').html(5 - parseInt(h_con / 20) + 's')
								if(h_con === 100) {
									clearTimeout(HONGBAO);
									var _x = $('.hob-inlet-02').offset().left - $(window).scrollLeft() + 60,
										_y = $('.hob-inlet-02').offset().top - $(window).scrollTop() + 50;
									$('.hongbao-wrapper').addClass('rotate').animate({
										'width': 0,
										'height': 0,
										'top': _y,
										'left': _x,
										'opacity': 0
									}, 500);
									$('.hongbao-wrapper *').addClass('rotate').animate({
										'width': 0,
										'height': 0,
										'top': _y,
										'left': _x,
										'opacity': 0
									}, 500, function() {
										$('.hongbao-wrapper').hide();
									});
								} else {
									h_con++;
								}
							},
							50);
					}

					///雨
					var _hob = $('.hongbao-wrapper');
					var _forget = $('.for-get-now');
					setTimeout(function() {
						hobYU()
					}, sessionStorage.getItem("aaaa"));
					setTimeout(function() {
						cz -= 1
						sessionStorage.setItem("aaaa", cz);
					}, 1000)

				});
					}
			</script>
		</div>

		<!-- 顶部tab -->
			<a  href="签到.html" class="space-15" style="position: absolute;right: 150px;top: 300px;z-index: 99;" />签到</a>

		<div class="tab-header">

			<div class="inner">
				<div class="pull-left">
					<div class="pull-left" id="up_left">嗨！<span class="cr" id="username">XXX</span></div>

				</div>
				<div class="pull-right" id="up_right">

				</div>
			</div>
		</div>

		<!-- 搜索栏 -->
		<div class="top-search" style="background: white;">
			<div class="inner">
				<a class="logo" href="index.html"><li id="logo"></li></a>
				<div class="search-box">
					<form class="input-group">
						<input id="searchInput" placeholder="🔍请输入你想要的内容" autocomplete="off" type="text">
						<span class="input-group-btn">
						<button type="button" id="ddddd" onclick="sousou()">
							<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
						</button>
						</span>
					</form>
						<div class="aaa">
						<ul id="viewContent" class="viewContent" style="z-index: 1000;position: absolute;background: white; width: 90%;">
						</ul>
						<ul id="viewContents" class="viewContents" style="z-index: 999;position: absolute;background: white; width: 90%;">

						</ul>
					</div>
					
					<p id="searchbox" class="help-block text-nowrap">

					</p>

				</div>
<!--
				<div id="zuo" class="hd">
					<a href="zjd/index.html"><img src="images/zjd.png" class="pt"></a>
				</div>-->

				<a href="zjd.html" class="hd">
		 <div style="position: fixed;bottom: 300px;right: 10.0px;z-index: 100000;cursor: pointer;
	width: 60.0px;height: 60.0px;line-height: 60.0px;background-image: url(images/jd.png);background-size: 60.0px 60.0px;" class="mm_wf_d11_shake">
		  
	
	</div>
	</a>

				<div class="cart-box c">
					<a href="udai_shopcart.html" class="cart-but">
						<i class="iconfont icon-shopcart cr fz16"></i> 购物车 0 件
					</a>
				</div>
			</div>
		</div>

		<!-- 首页导航栏 -->
		<div class="top-nav bg3">
			<div class="nav-box inner">
				<div class="all-cat">
					<div class="title"><i class="iconfont icon-menu"></i> 全部分类</div>
					<div class="cat-list__box">
						
					</div>
				</div>
				<ul id="nva-list" class="nva-list">
				
				</ul>
				<div class="user-info__box">
					<div class="login-box">
						<div id="imgbox" class="avt-port">
							
						</div>
						<!-- 已登录 -->
						<div class="name c6">
							<span id="">
							Hi~
							</span>
							<span id="nicknamebox"></span>
						</div>

			
					</div>
				<div class="login-box">
						<img src="./images/小桌宠.gif" width="200px" />
					</div>
				</div>
			</div>
		</div>
		<!-- 顶部轮播 -->
		<div class="swiper-container banner-box">
			<div class="swiper-wrapper" id="up_lunbo">          
			</div>
			<div class="swiper-pagination">
				
			</div>

		</div>
		
		
		<!-- 首页楼层导航 -->
		<nav class="floor-nav visible-lg-block">
			<span class="scroll-nav active">秒杀</span>
			<span class="scroll-nav">领卷中心</span>
			<span class="scroll-nav">个性推荐</span>

		</nav><br>
		      
	<!-- 楼层内容 -->
			<div id="body">

			<section class="scroll-floor floor-1 clearfix" onclick="luan()">
						<div id="xp" >
				 <div class="se-kl">
			    <div class="se-cn">倒计时</div>
			    <div class="se-en">COUNT DOWN</div>
			    <i class="se-io"></i>
			    <div class="se-info">距离结束还剩</div>
			    <div class="se-count">
			        <div class="se-day"></div>
			        <div class="se-hour"><span class="se-txt" id="shi">00</span></div>
			        <div class="se-min"><span class="se-txt" id="fen">00</span></div>
			        <div class="se-sec"><span class="se-txt" id="miao">00</span></div>
			    </div>
			    
			    	<div id="ms">
				
			</div>
			
			</div>
		
			</div>
			
			</section>
			<br>

			<section class="scroll-floor floor-2 ">
				<div id="lingjhuan" onclick="juan()">
					<div id="xp" style="width: 80%; position:relative; left: 0px;top: -50px;">

						<section class="scroll-floor floor-2 ">
							<div class="banner-imgBox">
								<div class="banner-imgBox2">
									<img src="images/yhrk.jpg" style="width: 1200px;" salt="">

								</div>
								<div class="banner-imgBox-div">
									<div class="on"></div>
									<div class="on"></div>
									<div class="on"></div>
									<div class="on"></div>
									<div class="on"></div>
								</div>

			               </section>

						</div>

					</div><br>
			</section>
			<section class="scroll-floor floor-3 ">


	<!--个性推荐老铁-->
				<div id="h">
					<h1 style="text-align: center;">个性推荐</h1><br>

				</div>
				<div class="hotsale-ft" style="color: #3C3C3C;
    -webkit-font-smoothing: antialiased;
    font: 12px/1.5 tahoma, arial, 'Hiragino Sans GB', '\5b8b\4f53', sans-serif;
    height: 50px;
    background: #fff;
    position: relative;">
					<i class="hotsale-end" style="    -webkit-font-smoothing: antialiased;
    font: 12px/1.5 tahoma, arial, 'Hiragino Sans GB', '\5b8b\4f53', sans-serif;
    position: absolute;
    text-align: center;
    color: #ccccd0;
    left: 50%;
    width: 84px;
    line-height: 20px;
    font-size: 18px;
    margin-left: -42px;
    font-style: normal;
    top: 20px;
    display: inline;" data-spm-anchor-id="a21bo.jianhua.201876.i0.5af911d9KNf8Sq">---  END --</i>

				</div>
				<br><br>
			</section>
			</div>
		</div>

	
<script>
	
//获取cookie 
	function getCookie(cookieName) {
    var strCookie = document.cookie;
    var arrCookie = strCookie.split("; ");
    for(var i = 0; i < arrCookie.length; i++){
        var arr = arrCookie[i].split("=");
        if(cookieName == arr[0]){
            return arr[1];
        }
    }
    return "";
}
  
	 		   selects();
     	//模糊查询
     	function selects(){   		
     		$.ajax({
     			type:"get",
     			url:"http://localhost:16111/memurbac/reachbyuseridmemu",
     			dataType:"json", 
     			xhrFields:{withCredentials: true},
     			data:{userid:2},
     			success:function(res){
     				//表示为查询成功，
     				if(res.code==200){

    				
     					   	//添加菜单列表
    		          	
     					for(var i in res.data){
    						
     						if(res.data[i].memu_name=="搜索栏菜单-max"){
    							
     							var data=res.data[i];
     					         
    							
   							for (var a in data.childMemu) {
   								
   								str="<a id='ssxm' style=\"padding-left:10px;\">"+data.childMemu[a].memu_name+"</a>"
   								$('#searchbox').html($('#searchbox').html()+str);
   							}
    							
     						}
     						
     						
     						
     							if(res.data[i].memu_name=="商城轮播菜单-max"){
    							
     							var data=res.data[i];
     					         
    							
   							for (var d in data.childMemu){
   								
   							
   								str="<div class=\"swiper-slide\"><a href=\""+data.childMemu[d].memu_url+"\"><img src=\""+data.childMemu[d].memu_picture+"\" id=\"coverimg\" class=\"cover\"></a></div>";
   								$('#up_lunbo').html($('#up_lunbo').html()+str);
   							
   								
   							}
   							
   			$(document).ready(function(){ 
			// 顶部banner轮播
			var banner_swiper = new Swiper('.banner-box', {
				autoplayDisableOnInteraction : false,
				pagination: '.banner-box .swiper-pagination',
				paginationClickable: true,
				autoplay : 5000,
			});
			
		});
   							
   						    
    							
     						}
     						
     			
				
    						
     						if(res.data[i].memu_name=="商城主菜单-max"){
    							
     							var data=res.data[i];
     					    //  console.log(JSON.stringify(data))
    							
   							for (var b in data.childMemu) {
   								

   								if(data.childMemu[b].memu_name=="主页"){						
   									str="<a  href=\""+data.childMemu[b].memu_url+"\"><li style=\"color: #f00;\"> "+data.childMemu[b].memu_name+" </li></a>"
   								}else{
   									str="<a href=\""+data.childMemu[b].memu_url+"\"><li> "+data.childMemu[b].memu_name+" </li></a>"
   								}
  								
  								
   								$('#nva-list').html($('#nva-list').html()+str);
   							}
    							
     						}
							
							
							
    						
     						if(res.data[i].memu_name=="用户主页顶部菜单-max"){
     							var data=res.data[i];
     							//alert(JSON.stringify(data.childMemu));
     										for(var c in data.childMemu){
    						
                           if(getCookie("userid")!=null&&getCookie("userid")!=""){
                           	
                           	              
                        if(data.childMemu[c].memu_name==="登录"){
                      		
                 $.ajax({
					url: 'http://localhost:16111/user/selectmydata',
					type: 'get',
					dataType: 'json',
					data:{userid:getCookie("userid")},
					success: function(data) {
						
							$('#username').html(data.userData.user_name);
					}
				});
                        		
                        	
                        		var str="<a  onclick=\"rest()\"><span class=\"cr\">退出登录</span></a>"
                        	}else{
                        		var str="<a href=\""+data.childMemu[c].memu_logurl+"\">"+data.childMemu[c].memu_name+"</a>";
                        	}
                        	
                        	
                        	

                          }else{
                          	
                          	var str="<a href=\""+data.childMemu[c].memu_url+"\">"+data.childMemu[c].memu_name+"</a>";
                          }
                           
                           
             

                    

			  
	 			        if(c<2){       	
	 			          $('#up_left').html($('#up_left').html()+str);	
				        }else{
	 			          $('#up_right').html($('#up_right').html()+str);
	 			        }
				  	
                     
                       }
     			}
    						    	
    		
    						
    						
     					}
    					        
    					
     				}else{
    					
     					layui.use("layer", function () {
                 //提示错误信息
     					layer.msg(res.error,{icon:7,time:1000});
              })

    					
    				
    				}
    			},
    			error:function(error){
    			
    				layui.use("layer", function (){
             	//提示错误信息
    				layer.msg(JSON.stringify(error),{icon:2,time:1000});
             })
    				
    			}
    		});
   
    	}
     		$(document).ready(function(){ 
		
			// 楼层导航自动 active
			$.scrollFloor();
			// 页面下拉固定楼层导航
			$('.floor-nav').smartFloat();
			$('.to-top').toTop({position:false});
		});
     	
     	//退出登录,
      function	rest(){               
      	//清除token
     	 document.cookie="token=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=localhost";
     	 //清除userid
     	 document.cookie="userid=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=localhost";
     		
     	//刷新本页面
     	location.reload();
     	}
      
			$(document).ready(function() {

				// 楼层导航自动 active
				$.scrollFloor();
				// 页面下拉固定楼层导航
				$('.floor-nav').smartFloat();
				$('.to-top').toTop({
					position: false
				});
			});

		
</script>
		<!-- 右侧菜单 -->
		<div class="right-nav">
			<ul class="r-with-gotop">
				<li class="r-toolbar-item">
					<a href="udai_welcome.html" class="r-item-hd">
						<i class="iconfont icon-user"></i>
						<div class="r-tip__box"><span class="r-tip-text">用户中心</span></div>
					</a>
				</li>
				<li class="r-toolbar-item">
					<a href="udai_shopcart.html" class="r-item-hd">
						<i class="iconfont icon-cart" data-badge="10"></i>
						<div class="r-tip__box"><span class="r-tip-text">购物车</span></div>
					</a>
				</li>
				<li class="r-toolbar-item">
					<a href="udai_collection.html" class="r-item-hd">
						<i class="iconfont icon-aixin"></i>
						<div class="r-tip__box"><span class="r-tip-text">我的收藏</span></div>
					</a>
				</li>
				<li class="r-toolbar-item">
					<a href="" class="r-item-hd">
						<i class="iconfont icon-liaotian"></i>
						<div class="r-tip__box"><span class="r-tip-text">联系客服</span></div>
					</a>
				</li>
				<li class="r-toolbar-item">
					<a href="issues.html" class="r-item-hd">
						<i class="iconfont icon-liuyan"></i>
						<div class="r-tip__box"><span class="r-tip-text">留言反馈</span></div>
					</a>
				</li>
				<li class="r-toolbar-item to-top">
					<i class="iconfont icon-top"></i>
					<div class="r-tip__box"><span class="r-tip-text">返回顶部</span></div>
				</li>
			</ul>
		</div>

		<style>
			.copyrights {
				text-indent: -9999px;
				height: 0;
				line-height: 0;
				font-size: 0;
				overflow: hidden;
			}
		</style>
		<div class="copyrights">
			Collect from
			<a href="http://www.cssmoban.com/" title="网站模板">模板之家</a>
			<a href="https://www.chazidian.com/" title="查字典">查字典</a>
		</div>
	<div id="dibu">
		
	</div>
	</body>
	
<script>
		function getuserid(cookieName) {
              var strCookie = document.cookie;
              var arrCookie = strCookie.split("; ");
              for(var i = 0; i < arrCookie.length; i++){
                 var arr = arrCookie[i].split("=");
                 if(cookieName == arr[0]){
                 return arr[1];
                 }
               }
               return "";
            }
		//console.log(sessionStorage.getItem("userid"))
		$("#dingdan").load("index_head.html");
		$.ajax({
			url: 'http://localhost:16111/goods/g_cnxh',
			type: 'get',
			dataType: 'json',
			data: {
				'userid':getuserid("userid") 
			},
			xhrFields:{withCredentials: true},
			success: function(data) {
				if(data.code == 1) {
					for(var i in data.data) {

						var x = "<div id=\"hz-1\" onclick=\"goods_(" + data.data[i].id + ',' + data.data[i].category_id + ")\">" +
							"<img src=" + data.data[i].commodity_picture + " class=\"tp\" ><br><h4 class=\"q\">" + data.data[i].commodity_name + "</h4>" +
							"<h4 class=\"q\">想拥有仲夏夜是什么感觉</h4><p class=\"zt-1\">￥<span class=\"zt-2\">" + data.data[i].commodity_price + "</span></p></div>";
						$("#h").append(x);
					}

				} else {

				}
			}
		});

		function goods_(z, x) {
			location.href = "item_show.html?id=" + z + "=" + x;
		}

	function lX() {
			$.ajax({
				xhrFields:{withCredentials: true},
		    		url: 'http://localhost:16111/activity/admin',
				type: 'get',
				dataType: 'json',
				data: {
					fen: 0
				},
				success: function(data) {
					var str = "";
					var s=document.getElementsByClassName("hd");
					var w=0;
					for(i in data) {
						if(data[i].status == 0) {
							
							s[w].style.display="none";
							w++;
						}
					}
					

				}
			});

		}

		 lX();
	</script>

<script type="text/javascript">   //分类查询
   $("#dibu").load("底部页面.html")
				foot () 
			function foot () {
						$.ajax({
            url: 'http://localhost:16111/goods/fl',
            xhrFields:{withCredentials: true},
            dataType: 'json',
            type:"post",
            success:function(data){
            var str = '';
          	var user = eval('(' + JSON.stringify(data) + ')')
            for(var i in user.data){
        			str+="<div class=\"cat-box\">"+
        			
						"<div class=\"title\"><i class=\"iconfont  ce\"></i>"+user.data[i].category_name+" </div>"+ 
						"<ul class=\"cat-list clearfix\">";
						for(var a in user.data[i].child){
						str+="<li><span calss=\"text-overflow\" style=\" font-size: 10px;\">"+user.data[i].child[a].category_name+"</span></li>";
						}
						str+="</ul>";
						
						str+="<div class=\"cat-list__deploy\">"+
							"<div class=\"deploy-box\">";
								for(var a in user.data[i].child){
									str+="<div class=\"genre-box clearfix\">";
								  str+="<span class=\"title\" style=\"\">"+user.data[i].child[a].category_name+"：</span>";
								 str+="<div class=\"genre-list\">"
								   for(var o in user.data[i].child[a].child){
								 str+="<a  class=\"sansan\">"+user.data[i].child[a].child[o].category_name+"</a>";
									}
								
								str+="</div></div>";
								}
									
							str+="</div>"
							+"</div>"
							+"</div>";
        }
        $(".cat-list__box").html(str);
             }
        })
	}
			

				</script>



<!--欧阳华林进入搜索界面入口jsp-->

<script type="text/javascript" charset="utf-8">
	// https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd='关键字'&cb=jQuery11020934050068638484_1563500786346&_=1563500786361
	var mySearch = (function() {
		var $searchInput = $("#searchInput"),
			$viewContent = $(".viewContent"),
			searchKey = '';

		function callBack(data) {
			var str = '';

			var user = eval('(' + JSON.stringify(data) + ')')

			for(var i in user.data) {
				// 默认显示4条信息
				if(i <= 9) {
					str += "<li class=\"lis\">" + user.data[i].category_name + "</li>"

				}

			}
			$viewContent.html(str);
			$viewContent.show();
		};

		function bindHtml() {
			// getData
			$.ajax({
				url: 'http://localhost:16111/goods/shopss',
				xhrFields:{withCredentials: true},
				dataType: 'json',
				type: "post",
				data: {
					category_name: searchKey
				},
				success: callBack
			})
		};

		function init() {
			// 获取搜索框的关键字
			$searchInput.on('focus keyup', function() {
				// 把空格开头和空格结尾换成空字符串
				searchKey = $(this).val().replace(/(^ +| +$)/g, '');
				if(searchKey.length > 0) { //如果输入框有值
					bindHtml();
					return false;
				}

				// 输入框没有值
				$viewContent.stop().slideUp(300);
			}).on('blur', function() {
				// 失去焦点搜索框收缩即可 这里的计时器是用来解决最后几个li点不到的bug
				setTimeout(function() {
					$viewContent.stop().slideUp(300);
				}, 300)
			});
			// 给li绑定方法
			$viewContent.on('click', "li", function(e) {
				$searchInput.val($(this).html());
				var a = ($(this).html());
				sousou();
			});
		};
		return {
			init: init
		}
	})();
	mySearch.init();
	
	$(document).on("click", ".sansan", function() {
		var a=$(this).text();
		var s=$('#searchInput');
		s.val(a);
		sousou();
})
	
	$(document).on("click", "#ssxm", function() {
		var a=$(this).text();
		var s=$('#searchInput');
		s.val(a);
		sousou();
})
	
	
</script>

<script type="text/javascript" charset="utf-8">
	// https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd='关键字'&cb=jQuery11020934050068638484_1563500786346&_=1563500786361
	var mySearch = (function() {
		var $searchInput = $("#searchInput"),
			$viewContent = $(".viewContents"),
			searchKey = '';

		function callBack(data) {
			var str = '';
			var user = eval('(' + JSON.stringify(data) + ')')
			str += "<div style=\"color: darkgrey;\"> 最近搜过 </div>"
			for(var i in user.data) {
				// 默认显示4条信息
				if(i <= 9) {
					str +=
						"<div class=\"test\">" +
						"<li class=\"ppp\" style=\"display: none;\">" + user.data[i].id + " </li>" +
						"<li class=\"lis\">"+user.data[i].value+"</li>" +
						"<div style=\"margin-top:-23px ;\"><a class=\"delsss\" ><span>删除</span></a></div>" +
						"</div>"
				}
			}
			$viewContent.html(str);
			$viewContent.show();
		};

		$(document).on("click", ".delsss", function() {
			var id = $(this).parent().parent().find(".ppp").text();
			$.ajax({
				url: 'http://localhost:16111/goods/dele',
				xhrFields:{withCredentials: true},
				dataType: 'json',
				
				type: "post",
				data: {
					id: id
				},
				success: function(data) {
					setInterval(document.getElementById('searchInput').click(), 1);
				}
			})
		})

		function kkkk() {
			
			var userid = getuserid("userid");
			$.ajax({
				url: 'http://localhost:16111/goods/ls',
				xhrFields:{withCredentials: true},
				dataType: 'json',
				type: "post",
				data: {
					userid: userid
				},
				success: callBack
			})
		};

		function init() {
			// 获取搜索框的关键字
			$searchInput.on('focus keyup', function() {
				// 把空格开头和空格结尾换成空字符串
				searchKey = $(this).val().replace(/(^ +| +$)/g);
				if(searchKey.length == 0) { //如果输入框没有值
					kkkk();
					return false;
				}

				// 输入框没有值
				$viewContent.stop().slideUp(300);
			}).on('blur', function() {
				// 失去焦点搜索框收缩即可 这里的计时器是用来解决最后几个li点不到的bug
				setTimeout(function() {
					$viewContent.stop().slideUp(300);
				}, 300)
			});
			// 给li绑定方法
			$viewContent.on('click', "li", function(e) {
				$searchInput.val($(this).html());
				var a = ($(this).html());
				localStorage.setItem("kuang", a);
				window.location.href = "搜索界面.html";
			});
		};
		return {
			init: init
		}
	})();
	mySearch.init();

	function sousou() {
		var userid = getuserid("userid");
		var value = document.getElementById("searchInput").value;
		if(value != "" && userid != null) {
			functionmm();
		} else {
			localStorage.setItem("kuang", value);
			window.location.href = "搜索界面.html";
		}

		function functionmm() {
			$.ajax({
				url: 'http://localhost:16111/goods/indata',
				dataType: 'json',
				type: "post",
				xhrFields:{withCredentials: true},
				data: {
					value: value,
					userid: getuserid("userid")
				},
				success: function(data) {
					localStorage.setItem("kuang", value);
					window.location.href = "搜索界面.html";
				}
			})
		}

	};
	
	$(document).ready(function(){
		//显示个人资料//
		$.ajax({
	        type:"GET",
	        url:"http://localhost:16111/user/selectmydata?userid="+getuserid("userid"),
	        dataType:"json",
	        xhrFields:{withCredentials: true},
	        success:function(result){
	        	//添加头像（带空值判断）//
	           	if(result.userData.user_img==null){
	           		$("#imgbox").append("<img  id='headimg' alt='欢迎来到XXX' src='user/headimg/fcbh.png' class='cover b-r50'>");
	           	}else{
	           		$("#imgbox").append("<img  id='headimg' alt='欢迎来到XXX' src='"+result.userData.user_img+"' class='cover b-r50'>");	
	           	}
	            //添加昵称//
	            $("#nicknamebox").text(result.userData.user_name);
	            
	        }	
	    });
	})
	
	   selecttime()
       var diyige=setInterval(diyige,1000);
		function sss() {

			location.href = "红包雨.html"
		}

		function luan() {

			location.href = "秒杀.html"
		}

		function juan() {
		location.href = "领劵中心.html"
		}

</script>

</html>